package com.zhuangwei;

import cn.hutool.core.util.StrUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 编写启动类
 *
 * @author LeviCoder
 * @create 2019-03-13 22:37
 */
@SpringBootApplication
@RestController
public class SpringBootDemoHelloworldApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemoHelloworldApplication.class, args);
    }

    @GetMapping("/hello")
    public String hello(@RequestParam(required = false,name = "who") String who){
        if (StrUtil.isBlank(who)){
            who = "world";
        }
        return StrUtil.format("hello,{}",who);
    }
}
